home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 19 / Mac Magazin and MacEasy Magazine CD - Issue 19.iso / Grafik & Text & Film / Quark XTensions / Freeware Xtensions / Quark AppleScript Scripts / Scripts (text only) / Set Page Guides < prev    next >
Text File  |  1994-05-02  |  2KB  |  65 lines

  1. --Copyright 1994 Quark, Inc.   All rights reserved.
  2.  
  3.  
  4. tell application "QuarkXPress™"
  5.     activate
  6.     if exists (document 1) then
  7.         repeat
  8.             tell document 1
  9.                 set pgcnt to count of pages
  10.                 set x to false
  11.                 set y to false
  12.                 repeat until x is true
  13.                     if pgcnt > 1 then
  14.                         display dialog "                          Set Page Guides
  15.         
  16.         
  17. There are " & pgcnt & " pages in this document.
  18.  
  19. Apply guide to page:" default answer 1
  20.                     else
  21.                         display dialog "                          Set Page Guides
  22.         
  23.         
  24. There is " & pgcnt & " page in this document.
  25.     
  26. Apply guide to page:" default answer 1
  27.                     end if
  28.                     try
  29.                         set pgnum to text returned of result as integer
  30.                         if pgnum ≤ pgcnt and pgnum ≥ 1 then
  31.                             set x to true
  32.                         end if
  33.                     on error
  34.                         set x to false
  35.                     end try
  36.                 end repeat
  37.                 tell page pgnum
  38.                     repeat until y is true
  39.                         set gdprp to display dialog "Place guide at:" default answer "" buttons {"Horizontal", "Vertical"}
  40.                         set gdpl to text returned of gdprp
  41.                         try
  42.                             if button returned of gdprp = "Horizontal" then
  43.                                 make horizontal guide at beginning with properties {position:gdpl}
  44.                                 set y to true
  45.                             else if button returned of gdprp = "Vertical" then
  46.                                 make vertical guide at beginning with properties {position:gdpl}
  47.                                 set y to true
  48.                             end if
  49.                         on error errtext number errNum
  50.                             if errNum = -1702 then
  51.                                 display dialog "" & errtext with icon stop
  52.                             else
  53.                                 display dialog "Improper number or measurement." with icon stop
  54.                             end if
  55.                             set y to false
  56.                         end try
  57.                     end repeat
  58.                 end tell
  59.             end tell
  60.         end repeat
  61.     else
  62.         display dialog "Please open a QuarkXPress™ document before running this script." buttons {"Cancel"} ¬
  63.             default button 1 with icon stop
  64.     end if
  65. end tell